<template>
  <div>
    <CategorySelector style="margin-bottom:10px" :disabledSelector="scene===1"></CategorySelector>
    <el-card>
      <SpuList v-if="scene===1" @changeScene="saveScene" @getData="saveData"></SpuList>
      <SpuForm v-if="scene===2" @changeScene="saveScene" :currentSpuInfo="currentSpuInfo"></SpuForm>
      <SkuForm v-if="scene===3" @changeScene="saveScene" :currentSpuInfo="currentSpuInfo"></SkuForm>
    </el-card>
  </div>
</template>

<script lang="ts">
import CategorySelector from '@/components/CategorySelector/index.vue'
import SpuList from './components/SpuList.vue'
import SpuForm from './components/SpuForm.vue'
import SkuForm from './components/SkuForm.vue'
export default {
    name:'spu',
    components:{
      CategorySelector,
      SpuList,
      SpuForm,
      SkuForm
    }
}
</script>
<script lang="ts" setup>
import {ref} from 'vue'
const scene = ref(1)
const currentSpuInfo = ref({})
// / 修改scene的值
const saveScene = (val:number)=>{
  scene.value = val
}
const saveData=(val)=>{
  currentSpuInfo.value = {...val}
}
</script>

<style>

</style>